Depression as Mathematics: States, Switches, Attractors, and the Treacherous Algebra of Mood
Depression, if forced into mathematics, would not be a single number called sadness; it would be a moving system whose variables refuse to sit politely in one row like schoolchildren.
That is the first useful correction. Ordinary speech treats depression as a mood. Clinical speech treats it as a syndrome. Mathematics would treat it as a trajectory through a state space, where the person is not merely “sad” but moving, slowing, looping, sinking, jolting, recovering, relapsing, overshooting, collapsing, and sometimes appearing outwardly functional while internally running on a battery last charged during the Mughal Empire.
The best branch of mathematics for this would not be arithmetic. Arithmetic is too innocent. It thinks one plus one equals two and goes home with clean hands. Depression needs dynamical systems, the mathematics of things that change over time; stochastic processes, the mathematics of noise, randomness, and unpleasant surprises; control theory, the mathematics of regulation and feedback; graph theory, if we want to model thoughts, habits, triggers, people, and institutions as connected nodes; and a little topology, because mood is not just where you are but what regions of experience are reachable from where you currently stand.
A basic symbol might be , the state of a person at time . But cannot be just mood. A serious model would make it a vector, meaning a bundle of variables traveling together: . Here might represent mood valence, from anguish to neutrality to pleasure. might represent energy or activation. might represent sleep quantity and regularity. might represent rumination, the mind’s ability to chew the same poisoned cud until dawn. might represent activity. might represent cognitive flexibility, the ability to shift perspective instead of becoming a fossil embedded in one thought. might represent physiological load: stress hormones, inflammation, pain, appetite disturbance, medication effects, circadian disruption, and all the bodily machinery that refuses the old fiction that mind and body are separate kingdoms.
Then the system changes according to some rule like . This little beast says: the current direction of change depends on the current state , external inputs , vulnerability parameters , noise , and time . It looks tidy. It is not tidy. It is a polite mathematical doily placed over a coal mine.
The input might include work stress, loneliness, grief, family conflict, weather, money, sunlight, medication, therapy, alcohol, social media, sleep deprivation, illness, or the small daily degradations of being alive in a system designed by committees and maintained by exhausted clerks. The parameter represents things that do not change quickly: genetics, early trauma, temperament, chronic illness, learned helplessness, social position, economic fragility, and whatever stubborn grooves the nervous system has carved over decades. The noise term is there because life is not a laboratory rat walking down a corridor under grant-funded lighting. Things happen. A message arrives. A job disappears. A memory returns. A friend says something stupid with surgical precision.
Unipolar depression, mathematically, might be modeled as a system with a dominant depressive attractor. An attractor is a region of state space toward which the system tends to drift. Imagine a marble rolling in a landscape. If the marble falls into a bowl, it stays there unless enough force pushes it out. In unipolar depression, the mood system may have a deep basin below the ordinary range of functioning. The person does not merely “choose” to remain depressed, any more than a marble at the bottom of a bowl chooses not to climb out and start a consultancy.
A crude model might say that mood moves according to something like . Here is mood, is a baseline, is the strength of return toward baseline, is rumination, is supportive input, and is noise. In a healthier system, is strong enough that bad days bend back toward ordinary days. In depression, the return force weakens, rumination strengthens, and the baseline itself may drift downward. The mathematics begins to resemble not a bad afternoon but a damaged thermostat in a freezing house.
Unipolar depression would also involve hysteresis. Hysteresis means the path down is not the same as the path up. The conditions that caused a depressive episode may no longer be present, but the system does not automatically return. This is one reason people who say “but things are better now” often sound like villagers shouting weather reports into a collapsed bridge. The bridge knows. The bridge is still collapsed.
Bipolar disorder [BD, a mood disorder involving episodes of depression and mania or hypomania] needs a richer model. It is not simply depression plus cheerfulness, which is one of the great public misunderstandings, right up there with thinking interoperability means two systems have exchanged a file and therefore understood each other. BD is better described as a multidimensional dynamical system with competing attractors, threshold effects, switching behavior, circadian sensitivity, and sometimes mixed states where variables that people assume should move together do not move together at all.
That last point matters. In ordinary imagination, mood and energy travel as companions: low mood means low energy, high mood means high energy. In BD, they can uncouple. One can have depressed mood with agitated energy, suicidal despair with racing thoughts, exhaustion with inner acceleration, or elevated activation without stable joy. Mathematically, that means and must be separate dimensions. The system is not a line. It is at least a plane, and probably a badly lit multidimensional warehouse with mislabeled shelves.
A simple phase-space picture would put mood on one axis and activation on another. Unipolar depression often occupies the low-mood, low-activation region, though anxious depression can complicate that. BD may move among low mood and low energy, high activation and elevated mood, high activation and low mood, and unstable intermediate regions. The clinically important thing is not only location but velocity: . How fast is the state changing? Is it drifting, cycling, accelerating, oscillating, or snapping across a threshold?
For BD, a more honest abstraction is a hybrid dynamical system. “Hybrid” here means the system has continuous changes within states and discrete switches between regimes. Depression, euthymia, hypomania, mania, and mixed states are not just different points on one ruler. They may be different operating modes, each with its own local rules. One regime says sleep loss worsens mood slowly. Another says sleep loss increases activation, which further reduces sleep, which increases activation again, and soon the system is not walking but galloping with a torch in its teeth.
That feedback loop might be written as . Here is activation, is sleep stability, is regulatory braking, is sensitivity to sleep loss, and is damping. If sleep drops and the system has high sensitivity, activation rises. If activation then further damages sleep, we get positive feedback. Positive feedback is not “positive” in the motivational-poster sense. It means self-amplifying. A microphone squeal is positive feedback. So is a bank run. So is a manic escalation when the braking system fails.
The non-obvious architectural insight is this: the distinction between unipolar depression and bipolar disorder is not only about which mood states occur, but about the transition architecture between states. Two people may look equally depressed on a Tuesday. Their scores on a symptom scale may be nearly identical. But one system may have a single deep depressive basin, while the other has hidden switches, asymmetric thresholds, circadian instability, and a history of activation overshoot. The visible state is not the whole system. In mathematics, as in healthcare data, a snapshot can lie without saying anything false.
That is also why representation failures are often mislabeled as data quality failures. If a clinic records “mood: depressed” without activation, sleep, velocity, prior episodes, medication exposure, seasonality, psychosis, mixed features, family history, and temporal sequence, the problem is not merely that the data are dirty. The representation is too poor for the phenomenon. Calling it bad data is like blaming a postcard for failing to contain the Bay of Bengal.
The same problem appears in Electronic Health Record [EHR, the clinical system used to document patient care] data. A diagnosis code may say major depression or bipolar disorder. A note may say “stable.” A medication list may imply one thing, a hospitalization another, a patient portal message a third. But the real clinical object is temporal and relational. It lives in sequences: sleep before mood shift, antidepressant before activation, stressor before collapse, agitation during despair, functioning after medication change. A table of disconnected facts does not automatically become a life just because it has timestamps.
Mathematically, depression asks us to care about latency. A cause may not produce an effect immediately. Sleep disruption today may destabilize mood next week. Social withdrawal may reduce distress in the next hour but deepen depression over months. Medication may improve one variable while worsening another. So we need lag terms: . The symbol is the lag, the delay between cause and visible consequence. In human terms, it is the fuse burning under the floorboards.
We also need thresholds. A person may absorb stress for weeks and appear unchanged, then suddenly cross into a different regime. Thresholds can be written as . If stress load exceeds threshold , depressive collapse becomes more likely. If activation exceeds threshold , hypomanic or manic dynamics may begin. But thresholds are not fixed stone gates. They move with sleep, medication, trauma, age, illness, social support, and accumulated burden. A threshold after six nights of poor sleep is not the threshold after six nights of decent sleep. The nervous system is not a spreadsheet. It is an orchestra tuning itself during an earthquake.
Unipolar depression might therefore be represented as a system with downward baseline drift, impaired recovery force, high rumination coupling, low reward responsiveness, and a deep depressive attractor. BD might be represented as a switching system with multiple attractors, unstable transitions, activation-mood uncoupling, sleep-sensitive feedback loops, and state-dependent rules. In unipolar depression, the main terror may be being pulled down and held. In BD, the terror may include being pulled down, flung up, mixed, accelerated, emptied, and then asked by society to explain yourself in neat sentences.
The branch of mathematics that best captures both is nonlinear dynamics. “Nonlinear” means outputs are not proportional to inputs. A small event can have a large effect if the system is near a threshold. A large event can sometimes produce surprisingly little visible change if the system is buffered. This is how a person can survive a major crisis and then be undone by a minor insult over tea. The insult is not the cause in isolation. It is the final gram placed on a structure already groaning.
Stochastic modeling adds another necessary insult to our pride. Even with good variables, the system remains probabilistic. We could write for the probability of a depressive state tomorrow given today’s state and inputs. For BD, we might write , where is the current mood regime and and are possible states. This resembles a Markov model, though real human mood is rarely memoryless. The past does not politely vanish after one time step. It leaves fingerprints everywhere.
Graph theory becomes useful when modeling thought and behavior. Rumination is not just “thinking a lot.” It is a network with high recurrence and low escape. Nodes are memories, fears, predictions, self-judgments, bodily sensations, and imagined futures. Edges are associations. In depression, the graph may become overly connected around negative nodes, like a city whose roads all lead to one damp municipal office where hope goes to renew a permit and dies in line.
Control theory asks a beautifully brutal question: what are the control inputs, and why do they fail? Sleep regularity, medication adherence, psychotherapy, exercise, light exposure, social rhythm, reduced alcohol use, meaningful work, financial stability, and crisis support can all act as regulatory inputs. But control is constrained by real life. A person cannot always sleep regularly while unemployed, overworked, grieving, poor, isolated, or living in a noisy house with three generations and a ceiling fan that sounds like a colonial helicopter. Clean solutions fail because the system is embedded in other systems.
This is the practical implication for design and governance, whether clinical, personal, or digital: do not model mood as a single score when the phenomenon is a temporal, multidimensional, state-switching process. Track sleep separately from mood. Track activation separately from pleasure. Track rumination separately from sadness. Track function separately from self-report. Preserve sequence. Preserve context. Preserve medication timing. Preserve uncertainty. If you flatten the system too early, you may achieve simplicity by deleting the very structure that mattered.
There is also a warning for artificial intelligence [AI, computational systems that learn patterns from data and make predictions or generate outputs]. An AI model trained on weak representations will not discover the missing ontology by magic. It may predict labels, but labels are often administrative fossils. A diagnosis code tells you what was billable, documented, suspected, inherited from a previous chart, or selected under time pressure. It does not necessarily tell you the governing dynamics of the person’s mood system. The machine may learn the paperwork and mistake it for the patient.
The clean mathematical dream would be to estimate every person’s parameters, identify attractors, detect early warning signals, and recommend stabilizing interventions before the system crosses a threshold. In symbols, we would infer from longitudinal data, estimate transition risk, and apply an input that minimizes expected harm. Lovely. Also not fully available in the real world, where data are sparse, privacy is essential, clinical notes are uneven, patients are not sensors, sensors are noisy, families are complicated, and a person may quite reasonably decline to have their suffering converted into a dashboard.
Still, the mathematical language helps because it refuses moral laziness. It does not say, “Why can’t you just cheer up?” It asks about attractor depth, damping, feedback, thresholds, noise, lag, coupling, and state transitions. It does not say, “You seemed fine yesterday.” It asks about hidden variables and unstable equilibria. It does not say, “But nothing happened.” It asks whether the system was already near a bifurcation point, where a tiny push changes the whole trajectory.
A bifurcation is when a system’s behavior changes qualitatively as a parameter changes. Heat water and nothing dramatic happens for a while; then it boils. Cool it and suddenly it freezes. Human beings are not water, but the metaphor earns its keep. Accumulated sleep loss, stress, isolation, medication changes, illness, or grief may alter parameters until the old equilibrium disappears. Then the person is not failing to return to normal. The previous normal is no longer a stable point.
For unipolar depression, the central mathematical image is a deep basin with weak escape energy. For BD, it is a landscape with several basins, unstable ridges, hidden switches, and weather that changes the map while you are walking through it. One is not milder or more respectable than the other. Both can be devastating. They differ in dynamics, not in dignity.
The deepest truth is that mood disorders are not merely contents of consciousness. They are regulation disorders across time. They involve brain, body, memory, sleep, meaning, social world, and institutional response. Mathematics cannot capture the taste of despair, the humiliation of explaining it, or the strange administrative comedy of trying to obtain care while your mind is busy eating its own furniture. But it can give us a sharper grammar. It can show why the old vocabulary is too flat.
So, if depression were mathematical, sadness would be only one variable. Unipolar depression would be a nonlinear stochastic system with a depressive attractor, delayed recovery, and distorted feedback. Bipolar disorder would be a hybrid dynamical system with coupled and uncoupled variables, regime switching, threshold instability, and circadian-sensitive feedback loops. The symbols would not cure anyone. Symbols are not medicine. But they can rescue the conversation from stupidity, and that is not nothing.
A good equation does not explain away suffering. It gives suffering a shape precise enough to stop blaming the sufferer for the geometry of the trap.